//
//  IndexTableViewController.m
//  CarTown
//
//  Created by 熊浩 on 15/8/1.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "IndexTableViewController.h"
#import "HeadView.h"
#import "CZSearchBar.h"
#import "IndexRightButton.h"
#import "IndexTableviewCell.h"
#import "SearchViewController.h"
#import "FindCarTableViewController.h"
#import "SelectPostViewController.h"
#import "SearchTableViewController.h"
#import "GotoViewController.h"
#import "MessageListTableViewController.h"
#import "HdeaderViewTableViewCell.h"
#import <MJRefresh.h>
#import "PostUitls.h"

#import "IndexCarModel.h"
#import "CarDetailmodel.h"
#import <SDWebImageManager.h>
#import "CommitInfoViewController.h"
#import "RootTabViewController.h"
#import "CZTabBar.h"
#import "CarDetailViewController.h"
#import "MyZTTableViewController.h"
#import "LookForCarViewController.h"
#import "Puser.h"
#import "PostCarTableViewController.h"
#import "GIFImageArray.h"
#import "SearchMode.h"
#import "PersonalDetailViewController.h"
#import "CompanyDetailViewController.h"
#import "MyCarViewController.h"
#import "CarTableViewController.h"

#define PERSONAL 22
@interface IndexTableViewController ()<UITextFieldDelegate,RightButtonClickDelegate,HeaderGridDelegate,SearchTableViewDelegate>
@property (nonatomic,assign) BOOL isshowSearch;
@property (nonatomic,strong) CZSearchBar *search;
@property (nonatomic,strong) HeadView *header;
@property (nonatomic,strong) UILabel *newheader;
@property (nonatomic,strong) NSMutableArray *indexcararray;
@property (nonatomic,strong) IndexRightButton *rightbutton;
@property (nonatomic,strong) Puser *user;
@property (nonatomic,copy) NSString *sectiontitle;
@end

@implementation IndexTableViewController

-(NSMutableArray *)indexcararray{
    if (_indexcararray==nil) {
        _indexcararray=[NSMutableArray array];
    }
    return _indexcararray;
}

-(Puser *)user{
    if (_user==nil) {
        _user=[Puser getUser];
    }
    return _user;
}

-(void)searchDidCancelClick{
    self.isshowSearch=NO;
    [self setNeedsStatusBarAppearanceUpdate];
}
-(void)getNotcount{
    
    NSMutableDictionary *params=[NSMutableDictionary dictionary];
    params[@"action"]=@"look_news";
    
    int power=[self.user.power intValue];
    
    params[@"from_id"]=power<5?self.user.user_id:self.user.com_id;
    if (power<5) {
        params[@"from_type"]=@"1";
    }else{
        if (power==8) {
            params[@"from_type"]=@"3";
        }else{
            params[@"from_type"]=@"2";
        }
    }
    
    [PostUitls Post:messageurl parameters:params success:^(id response) {
        NSDictionary *dict=response;
        NSNumber *data=dict[@"data"];
        [XHUserDeflaut setInteger:[data integerValue] forKey:NotReadState];
        if ([data integerValue]==0) {
            self.rightbutton.reddot.hidden=YES;
        }else{
            self.rightbutton.reddot.hidden=NO;
        }
        
    } failure:^(NSError *error) {
        
    }];
    
    
}

-(void)searchCilck:(PUSHTYPE)type WithString:(NSString *)string{
    self.isshowSearch=NO;
    [self setNeedsStatusBarAppearanceUpdate];
    if (type==PUSHTYPECar) {
//        RootTabViewController *roottab=self.navigationController.tabBarController;
//        [roottab.cztabBar setcheckItem:1];
        CarTableViewController *carvc=[[CarTableViewController alloc]initWithStyle:UITableViewStylePlain];
        carvc.hidesBottomBarWhenPushed=YES;
        [self.navigationController pushViewController:carvc animated:YES];
        
    }
    //    }else if (type==PUSHTYPEShop){
    //        if ([mode.user_id integerValue]!=0) {
    //            PersonalDetailViewController *pvc=[PersonalDetailViewController viewcontroller];
    //            pvc.user_id=mode.user_id;
    //            pvc.hidesBottomBarWhenPushed=YES;
    //            [self dismissViewControllerAnimated:YES completion:nil];
    //            [self.navigationController pushViewController:pvc animated:YES];
    //
    //        }else{
    //            CompanyDetailViewController *cvc=[CompanyDetailViewController viewcontroller];
    //            cvc.com_id=mode.com_id;
    //            cvc.parent_id=mode.parent_id;
    //             cvc.hidesBottomBarWhenPushed=YES;
    //            [self dismissViewControllerAnimated:YES completion:nil];
    //            [self.navigationController pushViewController:cvc animated:YES];
    //        }
    //
    //    }else{
    //        MyZTTableViewController *ztvc=[MyZTTableViewController viewcontroller];
    //        if ([mode.user_id integerValue]!=0) {
    //            ztvc.user_id=mode.user_id;
    //        }else{
    //            ztvc.com_id=mode.com_id;
    //        }
    //        ztvc.hidesBottomBarWhenPushed=YES;
    //        [self.navigationController pushViewController:ztvc animated:YES];
    //    }
}
-(void)setupNavBar:(BOOL)issearch{
    if (issearch) {
        [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[[UIColor alloc]initWithRed:46/255.0 green:141/255.0 blue:215/255.0 alpha:1.0]}
         ];
        [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"whilte_navbg"] forBarMetrics:UIBarMetricsDefault];
        [self.navigationController.navigationBar setTranslucent:YES];
        [self.navigationController.navigationBar setTintColor:[[UIColor alloc]initWithRed:46/255.0 green:141/255.0 blue:215/255.0 alpha:1.0]];
    }else{
        [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}
         ];
        [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbg"] forBarMetrics:UIBarMetricsDefault];
        [self.navigationController.navigationBar setTranslucent:YES];
        [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    }
}
-(HeadView *)header{
    if (_header==nil) {
        _header=[HeadView header];
        _header.delegate=self;
        _header.picarray=nil;
    }
    return _header;
}
- (UIStatusBarStyle)preferredStatusBarStyle
{
    return self.isshowSearch?UIStatusBarStyleDefault: UIStatusBarStyleLightContent;
}

#pragma -mark 首页按钮点击回调方法

/**
 *  首页按钮点击回调方法
 *
 *  @param index 点击按钮的索引
 */
-(void)click:(NSInteger)index{
    int power=[self.user.power intValue];
    switch (index) {
        case 0:
        {
            CarTableViewController *cvc=[[CarTableViewController alloc]initWithStyle:UITableViewStylePlain];
            cvc.hidesBottomBarWhenPushed=YES;
            [self.navigationController pushViewController:cvc animated:YES];
            
        }
            break;
        case 1:
        {
            if (power==1||power==5||power==8) {
                SelectPostViewController *pqgvc=[SelectPostViewController Viewcontroller];
                
                [self.navigationController pushViewController:pqgvc   animated:YES];
            }else if (power==6||power==2){
                MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
                hud.labelText=CheckIngString;
                hud.mode = MBProgressHUDModeText;
                hud.margin = 10.f;
                hud.removeFromSuperViewOnHide = YES;
                [hud hide:YES afterDelay:1];
            }else if(power==4||power==3)
            {
                CommitInfoViewController *gotovc=[CommitInfoViewController   viewcontroller];
                gotovc.typestr=@"发布求购";
                gotovc.navigationItem.title=@"发求购";
                [self.navigationController pushViewController:gotovc   animated:YES];
            }
        }
            break;
        case 2:
        {
            
            
            
            if (power==1||power==5||power==8) {
                MyZTTableViewController *vc=[MyZTTableViewController viewcontroller];
                
                [self.navigationController pushViewController:vc   animated:YES];
            }else if (power==6||power==2){
                MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
                hud.labelText=CheckIngString;
                hud.mode = MBProgressHUDModeText;
                hud.margin = 10.f;
                hud.removeFromSuperViewOnHide = YES;
                [hud hide:YES afterDelay:1];
            }else if(power==4||power==3)
            {
                CommitInfoViewController *gotovc=[CommitInfoViewController   viewcontroller];
                gotovc.typestr=@"查看我的展厅";
                gotovc.navigationItem.title=@"我的展厅";
                [self.navigationController pushViewController:gotovc   animated:YES];
            }
        }
            break;
        case 3:
        {
            
            if (power==1||power==5||power==8) {
                PostCarTableViewController *vc=[PostCarTableViewController viewcontroller];
                [self.navigationController pushViewController:vc animated:YES];
            }else if (power==6||power==2){
                MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
                hud.labelText=CheckIngString;
                hud.mode = MBProgressHUDModeText;
                hud.margin = 10.f;
                hud.removeFromSuperViewOnHide = YES;
                [hud hide:YES afterDelay:1];
            }else if(power==4||power==3)
            {
                CommitInfoViewController *gotovc=[CommitInfoViewController   viewcontroller];
                gotovc.typestr=@"发布车源";
                gotovc.navigationItem.title=@"发车源";
                [self.navigationController pushViewController:gotovc   animated:YES];
            }
            
            
            
        }
            break;
        case 4:
        {
            
            LookForCarViewController *lfcvc=[LookForCarViewController publish];
            
            [self.navigationController pushViewController:lfcvc   animated:YES];
        }
            break;
        case 5:
        {
            if (power==1||power==5||power==8) {
                MyCarViewController *vc=[[MyCarViewController alloc] init];
                vc.hidesBottomBarWhenPushed=YES;
                [self.navigationController pushViewController:vc animated:YES];
            }else if (power==6||power==2){
                MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
                hud.labelText=CheckIngString;
                hud.mode = MBProgressHUDModeText;
                hud.margin = 10.f;
                hud.removeFromSuperViewOnHide = YES;
                [hud hide:YES afterDelay:1];
            }else if(power==4||power==3)
            {
                CommitInfoViewController *gotovc=[CommitInfoViewController   viewcontroller];
                gotovc.typestr=@"查看我的车源";
                gotovc.navigationItem.title=@"我的车源";
                [self.navigationController pushViewController:gotovc   animated:YES];
            }
        }
            break;
        default:
            break;
    }
    
}


-(BOOL)checkPush{
    int power=[self.user.power intValue];
    if (power==1||power==5||power==8) {
        
        return YES;
    }else if (power==6||power==2){
        MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
        hud.labelText=CheckIngString;
        hud.mode = MBProgressHUDModeText;
        hud.margin = 10.f;
        hud.removeFromSuperViewOnHide = YES;
        [hud hide:YES afterDelay:1];
        return NO;
    }else if(power==4||power==3)
    {
        GotoViewController *gotovc=[GotoViewController   viewcontroller];
        
        [self.navigationController pushViewController:gotovc   animated:YES];
        return NO;
    }else{
        return NO;
    }
}

-(void)textFieldDidBeginEditing:(UITextField *)textField{
    self.isshowSearch=YES;
    [self setNeedsStatusBarAppearanceUpdate];
    SearchTableViewController *searchvc=[SearchTableViewController viewController];
    searchvc.modalPresentationStyle=UIModalPresentationOverFullScreen;
    searchvc.modalTransitionStyle=UIModalTransitionStyleCrossDissolve;
    searchvc.delegate=self;
    [self presentViewController:searchvc animated:YES completion:^{
        
    }];
    [textField endEditing:YES];
}
-(void)pushtoClass:(Class)clazz;{
    //    [self.navigationController pushViewController:[clazz class] animated:YES];
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.rightbutton.reddot.hidden=![XHUserDeflaut integerForKey:NotReadState]>0;
    [self setupNavBar:NO];
    [self getcount];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.tableHeaderView=self.header;
    
    [self setupheader];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    CZSearchBar *search=[[CZSearchBar alloc]initWithFrame:CGRectMake(0, 0, XHScreenwidth, 30)];
    search.placeholder=@"请输入车镇商品/店铺";
    search.font=[UIFont systemFontOfSize:14];
    
    self.navigationItem.titleView=search;
    self.search=search;
    search.delegate=self;
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pushtoVC:) name:NoticePushSUS object:nil];
    NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
    [defaultCenter addObserver:self selector:@selector(networkDidReceiveMessage:) name:kJPFNetworkDidReceiveMessageNotification object:nil];
    [self setupLeftRightButton];
    
    //   NSDictionary *dict=[DbUtils getuserinfo];
    //    [self.tableView registerNib: @"IndexTableviewCell" forCellReuseIdentifier:@"index"];
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
        
        [self.tableView setSeparatorInset:UIEdgeInsetsZero];
        
    }
    
    if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
        
        [self.tableView setLayoutMargins:UIEdgeInsetsZero];
        
    }
    
    
}

- (void)networkDidReceiveMessage:(NSNotification *)notification {
   
    [self getNotcount];
}

-(void)getcount{
    NSMutableDictionary *params=[NSMutableDictionary dictionary];
    params[@"action"]=@"all_count";
    [PostUitls Post:carurl parameters:params success:^(id response) {
        NSDictionary *dict=response;
        NSNumber *number=dict[@"data"];
        self.header.totalnumber=[number integerValue];
        
    } failure:^(NSError *error) {
        
    }];
}
-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [self.tableView.header beginRefreshing];
}

-(void)pushtoVC:(NSNotification *)notice{
    NSString *type=notice.userInfo[@"type"];
    NSString *ID=notice.userInfo[@"ID"];
    if ([type integerValue]==0) {
        CarDetailViewController *dvc=[CarDetailViewController viewcontroller];
        dvc.ID=ID;
        [self.navigationController pushViewController:dvc animated:YES];
    }
}

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
        
        [cell setSeparatorInset:UIEdgeInsetsZero];
        
    }
    
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        
        [cell setLayoutMargins:UIEdgeInsetsZero];
        
    }
    
    
    
}


-(void)setupheader{
    
  
    
    MJRefreshHeader *header=[MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(refreshing)];
    
    self.tableView.header=header;
    self.tableView.header.automaticallyChangeAlpha=YES;
    //    self.tableView.footer.hidden = YES;
    //    MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter  footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
    //
    //    footer.stateLabel.font=[UIFont systemFontOfSize:10];
    //    footer.stateLabel.textColor=RGBACOLOR(125, 125, 125, 1);
    //    self.tableView.footer=footer;
    
}
-(void)loadMoreData{
    NSMutableDictionary *params=[NSMutableDictionary dictionary];
    params[@"action"]=@"index";
    params[@"num"]=Kpagesize;
    
    NSMutableArray *IDSarray=[NSMutableArray array];
    for (CarDetailmodel *mode in self.indexcararray) {
        [IDSarray addObject:mode.ID];
    }
    
    params[@"page_id"]=[NSString DataTOjsonString:IDSarray];
    [PostUitls Post:carurl parameters:params success:^(id response) {
        NSLog(@"%@",response);
        NSDictionary *dict=response;
        IndexCarModel *carmode=[IndexCarModel indexcarWithDcit:dict];
        if ([carmode.state integerValue]==400) {
            [self.indexcararray addObjectsFromArray:carmode.data];
            [self.tableView.footer endRefreshing];
            [self.tableView reloadData];
            
        }else{
            [self.tableView.footer noticeNoMoreData];
            NSLog(@"%@",carmode.msg);
        }
        
    } failure:^(NSError *error) {
        NSLog(@"%@",error);
        [self.tableView.footer endRefreshing];
    }];
    
}

-(void)refreshing{
    
    
    NSMutableDictionary *params=[NSMutableDictionary dictionary];
    params[@"action"]=@"my_history";
    NSInteger power=[self.user.power integerValue];
    if (power<5) {
        params[@"type"]=@"person";
        params[@"user_id"]=self.user.user_id;
    }else{
        params[@"type"]=@"company";
        params[@"user_id"]=self.user.com_id;
        if (power==8) {
            params[@"pid"]=self.user.parent_id;
        }
    }
    params[@"num"]=IndexPageSize;
    
    [PostUitls Post:myhistoryurl parameters:params success:^(id response) {
        NSDictionary *dict=response;
        NSNumber *state=dict[@"state"];
        if ([state integerValue]==400) {
            [self.indexcararray removeAllObjects];
            
            NSMutableArray *marray=[NSMutableArray array];
            for (NSDictionary *ddict in dict[@"data"]) {
                CarDetailmodel *detail=[CarDetailmodel carWithdict:ddict];
                [marray addObject:detail];
                
            }
            [self.indexcararray addObjectsFromArray:marray];
            if (self.indexcararray.count>0) {
                
                self.sectiontitle=@"最近浏览车源";
                
                [self.tableView reloadData];
                [self.tableView.header endRefreshing];
                
            }else{
                [self getindexs];
            }
        }
        
    } failure:^(NSError *error) {
//        MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
//        
//        hud.labelText=@"网络错误";
//        hud.mode = MBProgressHUDModeText;
//        
//        hud.margin = 10.f;
//        
//        hud.removeFromSuperViewOnHide = YES;
//        [hud hide:YES afterDelay:1];
        [self.tableView.header endRefreshing];
    }];
    
    
    
    
    
    
    
}
-(void)getindexs{
    NSMutableDictionary *params=[NSMutableDictionary dictionary];
    params[@"action"]=@"index";
    params[@"num"]=IndexPageSize;
    
    [PostUitls Post:carurl parameters:params success:^(id response) {
        
        NSDictionary *dict=response;
        IndexCarModel *carmode=[IndexCarModel indexcarWithDcit:dict];
        if ([carmode.state integerValue]==400) {
            if (carmode.data.count>=[Kpagesize integerValue]) {
                [self.tableView.footer resetNoMoreData];
            }else{
                [self.tableView.footer noticeNoMoreData];
            }
            [self.indexcararray removeAllObjects];
            [self.indexcararray addObjectsFromArray:carmode.data];
    
            
            [self.tableView.header endRefreshing];
            [self.tableView reloadData];
            
        }else{
            [self.tableView.header endRefreshing];
            NSLog(@"%@",carmode.msg);
        }
        
    } failure:^(NSError *error) {
        NSLog(@"%@",error);
        [self.tableView.header endRefreshing];
    }];
    
}

-(void)setupLeftRightButton{
    
    IndexRightButton *rightbutton=[IndexRightButton right];
    rightbutton.rightclickdelegate=self;
    
    UIImageView *logoimage=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"LOGOtest"]];
    logoimage.contentMode=UIViewContentModeCenter;
    logoimage.width+=10;
    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithCustomView:logoimage];
    self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc] initWithCustomView:rightbutton];
    self.rightbutton=rightbutton;
    [self getNotcount];
    
}
-(void)rightclick{
    NSLog(@"消息被点击了");
    MessageListTableViewController *message=[MessageListTableViewController message];
    [self.navigationController pushViewController:message animated:YES];
    
}


-(void)HeaderImageClick:(NSInteger)index{
    if (index==0) {
        if ([self checkPush]) {
            MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
            hud.labelText=@"您已是认证用户";
            hud.mode = MBProgressHUDModeText;
            hud.margin = 10.f;
            hud.removeFromSuperViewOnHide = YES;
            [hud hide:YES afterDelay:1];
        }
    }
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    CarDetailmodel *cardtail=self.indexcararray[indexPath.row];
    CarDetailViewController *cardetailvc=[CarDetailViewController viewcontroller];
    cardetailvc.ID=cardtail.ID;
    [self.navigationController pushViewController:cardetailvc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, XHScreenwidth, 36)];
    lable.text=self.sectiontitle;;
    lable.backgroundColor=[UIColor whiteColor];
    lable.font=[UIFont systemFontOfSize:12];
    lable.textColor=textnormalGary;
    lable.layer.borderWidth=0.5;
    lable.layer.borderColor=[BoderColor CGColor];
    lable.textAlignment=NSTextAlignmentCenter;
     return lable;
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Potentially incomplete method implementation.
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete method implementation.
    
    // Return the number of rows in the section.
    
    return self.indexcararray.count;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    IndexTableviewCell *cell=[IndexTableviewCell cellWithTableView:tableView];
    cell.carmodel=self.indexcararray[indexPath.row];
    
    return cell;
    
    
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 36;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 52;
    
}

/*
 // Override to support conditional editing of the table view.
 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
 // Return NO if you do not want the specified item to be editable.
 return YES;
 }
 */

/*
 // Override to support editing the table view.
 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
 if (editingStyle == UITableViewCellEditingStyleDelete) {
 // Delete the row from the data source
 [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
 } else if (editingStyle == UITableViewCellEditingStyleInsert) {
 // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
 }
 }
 */

/*
 // Override to support rearranging the table view.
 - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
 }
 */

/*
 // Override to support conditional rearranging of the table view.
 - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
 // Return NO if you do not want the item to be re-orderable.
 return YES;
 }
 */

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
